class Person {
  protected name: string;
  private age: number;

  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }

  // private: 只有在类内部才能访问
  private eating() {
    console.log(this.name, this.age);
  }
}

class Student extends Person {
  constructor(name: string, age: number) {
    super(name, age);
  }

  studying() {
    console.log(this.name + "studying");
    // private只有自己的类的内部才能访问
    // console.log(this.age)
  }
}

const p1: Person = new Person("zs", 12);
// p1.eating()
// console.log(p1.name, p1.age);

const stu1 = new Student("ls", 12);
// protected， private这些修饰符只能在类内部才能访问
// console.log(stu1.name)

export {};
